type User = {
	id: number,
	kind: string
}

/*
* TS2322: Type '{ id: number; kind: string; }' is not assignable to type 'T'.   '{ id: number; kind: string; }'
* is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'User'.
* */
function makeCustomer<T extends User> (u:T):T {
	return {
		id: u.id,
		kind: 'customer'
	}
}
